package aiku.numericalcontroloa.Controller.paymentController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Service.Impl.PaymentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 马文杰
 * @version 1.0
 */
@RestController
@RequestMapping("/payment")
public class paymentController {
    @Autowired
    private PaymentServiceImpl paymentService;

    /**
     * 查询支出明细
     */
    @PostMapping("/purchaseList")
    public Result purchaseList(@RequestParam("page") Integer page, @RequestParam("size") Integer size,@RequestParam("type") String type) {
        return paymentService.purchaseList(page, size,type);
    }

    /**
     * 通过供应商查询总支出
     */
    @PostMapping("/purchaseReceiptsInfoList")
    public Result purchaseReceiptsInfoList(@RequestParam("type") String type) {
        return paymentService.purchaseReceiptsInfoList(type);
    }

    /**
     * 通过供应商id清空未结算
     */
    @PostMapping("/purchaseReceiptsInfos")
    public Result purchaseReceiptsInfos(@RequestParam("supplierId") String supplierId) {
        return paymentService.purchaseReceiptsInfos(supplierId);
    }
}
